<?php
class Form_BugReportForm extends Zend_Form
{
	public function init(){
		$author = new Zend_Form_Element_Text('author');
		$author->setLabel('Enter your name:')
				->setRequired(TRUE);
		$author->setAttrib("size", 30);
		$this->addElement($author);
		
		$email = new Zend_Form_Element_Text('email');
		$email->setLabel('Enter your email:')
				->setRequired(TRUE)
				->setAttrib('size', 30)
				->addValidator(new Zend_Validate_EmailAddress())
				->addFilters(array(
					new Zend_Filter_StringToLower(),
					new Zend_Filter_StringTrim(),
					new Zend_Filter_HtmlEntities(),
					new Zend_Filter_StripTags()
				));
		$this->addElement($email);
		
		$date = new Zend_Form_Element_Text('date');
		$date->setLabel('Date the issue occured (dd-mm-yyyy)')
			->setRequired(TRUE)
			->setAttrib('size', 30)
			->addValidator(new Zend_Validate_Date('DD-MM-YYYY'));
		$this->addElement($date);
		
		$url = new Zend_Form_Element_Text('url');
		$url->setLabel('Issue URL:')
			->setRequired(TRUE)
			->setAttrib('size', 30);
		$this->addElement($url);
		
		$description = new Zend_Form_Element_Textarea('description');
		$description->setLabel('Issue description:')
					->setRequired(TRUE)
					->setAttribs(array(
						'cols'	=>	50,
						'rows'	=>	4
					));
		$this->addElement($description);
		
		$arrPriority = array(
			'low'	=>	'Low',
			'medium'=>	'Medium',
			'height'=>	'Height'
		);
		$priority = new Zend_Form_Element_Select('priority', array("multiOptions" => $arrPriority));
		$priority->setLabel('Issue Priority:')
					->setRequired(TRUE);
		$this->addElement($priority);
		
		$arrStatus = array(
			'new'			=>	'New',
			'in_progress'	=>	'In Progress',
			'resolved'		=>	'Resolved'
		);
		$status = new Zend_Form_Element_Select('status', array('multiOptions' => $arrStatus));
		$status->setLabel('Current status:')
				->setRequired(TRUE);
		$this->addElement($status);
		
		$id = new Zend_Form_Element_Hidden('id');
		$this->addElement($id);
		
		$this->addElement('submit', 'submit', array('label' => 'Submit'));
		$this->setAttrib('accept-charset', 'utf-8');
	}
//    public function __construct ()
//    {
//        parent::__construct();
//    }
}
?>